﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Aprendete.Models
{
    public class ComentarioRepository
    {

        private DataClasses1DataContext db = new DataClasses1DataContext();

        public void Add(Comentario Comentario)
        {
            db.Comentarios.InsertOnSubmit(Comentario);
            db.SubmitChanges();
        }


        public void Save()
        {
            db.SubmitChanges();
        }


        public Comentario GetComentarioxid(int id)
        {
            return db.Comentarios.SingleOrDefault(d => d.ComentarioID == id);
        }

        public void Delete(Comentario Comentario)
        {
            db.Comentarios.DeleteOnSubmit(Comentario);
            db.SubmitChanges();
        }

    }
}